Skip to content

Fix acl check permission - #3618

Closed
supermafete wants to merge 6 commits into
strongloop:masterfrom
supermafete:fix-acl-checkPermission
Closed

supermafete wants to merge 6 commits into
strongloop:masterfrom
supermafete:fix-acl-checkPermission

Conversation

@supermafete

Copy link
Copy Markdown

Description

ACL.checkPermission is resolving the permission with highest score, no matter the principalType or principalId provided to the function.

Related issues

Checklist

  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style
    guide

@slnode

slnode commented Sep 18, 2017

Copy link
Copy Markdown

Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test."

@slnode

slnode commented Sep 18, 2017

Copy link
Copy Markdown

Can one of the admins verify this patch?

3 similar comments
@slnode

slnode commented Sep 18, 2017

Copy link
Copy Markdown

Can one of the admins verify this patch?

@slnode

slnode commented Sep 18, 2017

Copy link
Copy Markdown

Can one of the admins verify this patch?

@slnode

slnode commented Sep 18, 2017

Copy link
Copy Markdown

Can one of the admins verify this patch?

@bajtos

bajtos commented Sep 20, 2017

Copy link
Copy Markdown
Member

Hello @supermafete, thank you for the pull request. I am personally not familiar with this part of the code base, but I'll try to find some time to review your changes.

I think @ebarault @raymondfeng or perhaps even @alFReD-NSH may be more suited to review this change.

The following pull request may be related to this problem too: #3293

@supermafete

Copy link
Copy Markdown
Author

Please see last messages in #3518. I have been reviewing formatting problems. I worked in the branch for my own project, so I think the right commit for this PR is 191a563. Would you like me to make other PR?

Thanks.

@faridnsh

Copy link
Copy Markdown
Contributor

There's no test cases here. Without one, we can't see if this is making any difference or not. Also the build is not passing and commits need to be cleaned up.

@slnode

slnode commented Sep 27, 2017

Copy link
Copy Markdown

Can one of the admins verify this patch?

2 similar comments
@slnode

slnode commented Sep 27, 2017

Copy link
Copy Markdown

Can one of the admins verify this patch?

@slnode

slnode commented Sep 27, 2017

Copy link
Copy Markdown

Can one of the admins verify this patch?

@stale

stale Bot commented Nov 26, 2017

Copy link
Copy Markdown

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the stale label Nov 26, 2017
@stale

stale Bot commented Dec 10, 2017

Copy link
Copy Markdown

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.

@stale stale Bot closed this Dec 10, 2017
Comment thread common/models/acl.js

// Not really. We must find the first permission that matches our request
var new_candidate = acls.find((acl) => {
return ((acl.principalType === principalType) && (acl.principalId === principalId));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried out this PR as a monkey patch on my system. I had to add this condition:

(acl.accessType === req.accessType)

otherwise the permissions check would do things like allow write access when only read access was granted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants